\chapter{Introduction}

\section{Motivation}
\vspace{-4mm}
Enterprises face various challenges to create business value due to today's highly global economy, fast changing market conditions and regulations put in place by policymakers. As one consequence, companies may have started organizational engineering initiatives to become service-oriented organizations. Moreover, programmes to increase the agility to react quicker on strategic and technological changes on the one hand side and to reduce the complexity of operating environments on the other side have been observed.
\newline
\noindent
Particularly with the shift towards service-oriented organizations, enterprises need to transform traditional siloed information technology (IT) landscapes into more loosely coupled service-oriented computing (SOC) environments, in order a linkage between business processes and its underlying IT services can be established, known as \textit{Business-IT Alignment} reflected in figure \ref{Overview SOA}. Such an architectural view is defined by \textit{service-oriented architectures} (SOA), which takes enterprise-wide components, typically based on former paradigms like \textit{component-based software development} (CBSD) or \textit{object-orientation} (OO) and encapsulate them in ``building blocks'', so called \textit{software services}, which are required in the context of business process execution.

\begin{figure}[ht]
		\begin{center}
	    	\includegraphics[page=1, trim=1.7cm 3.0cm 2cm 2.3cm, width=14cm, clip=true]{graphics/approach}
			\caption[Overview SOA]{Architectural Overview Service-Oriented Architectures}
			\label{Overview SOA}
		\end{center}
\end{figure}

\noindent
By means of SOA, enterprises expect an increased degree of agility, as software services could be reused due to its agnostic service logic, once it comes to business process-optimization or -reengineering tasks. Therefore, a SOA should never be seen as a standalone investment. Following \textcite{Demirkan2008}, a single enterprise view of existing and future service-oriented technology assets is required for an organization to minimize any tendency toward development redundancy that will inflate costs and create unnecessary inefficiencies. A new managerial perspective, emphasizing the importance of encouraging the sharing of IT, data sharing and technology-related business practice across different business units, is required. Guaranteeing this, requires adherence to enterprise-wide methods, particularly in the area of \textit{service-oriented modelling} (SOM), as according to \textcite{Alahmari2011}, the outcome of SOA initiatives highly depends on the way, services are identified and designed. Coarse-grained services with too large scope are inflexible and hardly reusable, whereas too fine-grained services are difficult to manage, which is underpinned by Gartner \parencite{Gartner2008}, saying, that bundling too many dissimilar functions together results in services encapsulating unrelated service logic and therefore affects usability, decreases performance and drives up management costs. Following this viewpoint, \textcite{Feuerlicht2007} see the design of services primarily driven by performance and scalability considerations, than on software-engineering principles. Thus, SOA initiatives are doomed to failure and strategic SOA objectives can only be hardly achieved.
\newline
\noindent
Reflecting the SOA challenge from a business process perspective, functional experts in their domains are impacting the evolution of SOA initiatives too, as many of today's service-design approaches are initiated from functional area (top-down), where business processes are modeled. The execution of such business processes is ideally supported by orchestration platforms, which preserve conversational state information resulting from the invocation of services within a SOA. ''Business People'' typically see only the value of coarse-grained services \parencite{Haesen2008}, as such services can be related with activities belonging to a business process. Hence, the dilemma that Business appreciates coarse-grained services, whereas IT is trying to find a best-fit solution including fine-grained services can often be observed. 
\newline
\noindent
However, the degree of granularity of services within a SOA is seen as a crucial parameter, more precisely as an independent criteria influencing internal and external structural software attributes\footnote{Note, internal and external structural software attributes are explained in the upcoming chapter \textit{Theoretical Foundation}.}, such as the ones defined in ISO/IEC 9126. Hence, one crucial question is, how could an approach look like, supporting SOM by giving indications whether a service design or a current solution is aligned with overall SOA guidelines? To approach this question, firstly the prerequisite basis regarding the structure of a SOA needs to be maintained in a \textit{service inventory}. Secondly, by means of \textit{software-metrics}, the internal structural software attributes, such as \textit{cohesion} and \textit{coupling} can be revealed. On top of that, service granularity serves as an independent indicator. Thirdly, by relating the results out of the software metrics and the overall independent parameter - service granularity, correct conclusions towards the \textit{target model} of a SOA can be drawn.
\newline
\noindent
 One prominent field of applications is in the context of SOM, where the potential of service designs can be evaluated against service metrics covering per service model the best-practice design principles. As a result of  the SOM phase, an early detection of design flaws is aided, different design options and trade-offs could be considered and last but not least planning for development, testing and governance of the services is supported \parencite{Sindhgatta2009}. A further field is the creation of a managerial perspective for  ``\textit{senior executives} (SE), which outlines the fit of SOA initiatives with respect to business requirements due to business strategy shifts or fulfillment of regulations. For instance, the degree of \textit{Maintainability} (and its set of related attributes in ISO/IEC 9126) could be an important indicator when it comes to strategy changes (ie. establishment of new business processes in emerging markets). By means of a service inventory capable of storing dependencies among services, overall key performance indicators (KPI) could be made transparent.
\newline
\noindent
Anyhow, in the upcoming sections of this work an approach of measuring the service granularity is elaborated. As a consequence, the objective is, that services are designed and implemented according best-practices guidelines, thus fitting into a SOA journey to last for some time. 

\section{Research Problem}
\vspace{-4mm}
Comparing the methodology between developing software systems in a traditional approach with the idea of SOA, the main difference is to separate the process-logic and process-control in system design. In order to fortify investments in SOA, the strategic objectives of SOA, according to \textcite{Erl2008}, are
\begin{itemize}
\item to enhance the interoperability between systems to decrease the need for integration,
\item to increase federation by guaranteeing ``widespread deployment of standardized and composable services'' in the enterprise,
\item to increase vendor diversification, which provides the ability ``to change, extend, and even replace solution implementations without disrupting the overall service architecture'' and
\item to increase business and technology domain alignment by establishing ``service layers that accurately encapsulate and represent business models, which are aligned with business needs''.
\end{itemize}

\noindent
According to \textcite{Alahmari2010}, research mostly has concentrated on the one hand side on the definition of overall SOA guidelines, aiming for strategic SOA objectives.

\begin{figure}[ht]
		\begin{center}
	    	\includegraphics[page=3, trim=12.60cm 5.05cm 5.13cm 9.51cm, keepaspectratio=true, scale=1, clip=true]{graphics/approach}
			\caption[Overview of service granularity and its dependent parameters]{Overview of service granularity and its dependent parameters}
			\label{Overview of service granularity and its dependent parameters}
		\end{center}
\end{figure}

\noindent
On the other hand, it could be observed, particularly as consequence of the SOA ``hype'' and the encountered problems in the practice regarding service granularity, that research contributions came up with answers regarding measuring the service granularity. To be more accurate, there have been metrics defined, capable of quantifying the service granularity of a software service. Moreover, to be considered in this context is, that granularity is seen as the independent parameter, whereas internal and external structural software-attributes depend on granularity, as seen in figure \ref{Overview of service granularity and its dependent parameters}. Internal (partly external) structural parameters have been addressed by means of metrics too. Thus, the individual parameters in the model may exist, but relating them with the concepts of \textit{Service Orientation} is rarely researched.
\newline
\noindent
In particular, the characteristic of the parameters in the model are highly dependent on the \textit{service model}. Following SOA best- practices, there are at least four essential service models\footnote{Note, the service models are explained in the upcoming chapter \textit{Theoretical Foundation}.}, targeting a specific purpose within a SOA. Bringing these service models into context with the service dimensions, seen in figure \ref{Overview service dimensions}, the various service models support specific characteristics along the service dimensions. For instance, a  process service encapsulates several activities, thus most potentially a broader range, realm and reach, compared to a task service.

\begin{figure}[ht]
		\begin{center}
	    	\includegraphics[page=4, trim=5.02cm 7.65cm 4.22cm 3.49cm, keepaspectratio=true, scale=0.6, clip=true]{graphics/approach}
			\caption[Overview service dimensions]{Overview service dimensions (adapted from \cite{Reldin2007})}
			\label{Overview service dimensions}
		\end{center}
\end{figure}

\noindent
Hence, it could be stated, that out of today's metrics a suitable combination might be found per service model to be finally in a position to give recommendation, whether the assessed service is in accordance to SOA best-practices, under the condition, that the applied metrics per service model cover  the best-practice principles of service design.

\section{Research Questions}
\vspace{-4mm}
The following research questions are considered in the context of this thesis:
\begin{itemize}
  \item How can service granularity be measured?
  \item Which parameters are influenced by service granularity?
  \item What is the relation between service models and service granularity?
  \item How could an overall approach look like to measure service granularity within a SOA?
\end{itemize}

\section{Objectives}
\vspace{-4mm}
This thesis intends to define an approach of measuring certain parameters, such as service granularity, cohesion and coupling, of a service design within a SOA and gives a qualitative indication, whether the individual services in the overall service design correspond to SOA best-practice principles. The approach is structured into the following five steps:

\begin{enumerate}
  \item The target model, outlining the service layers within the SOA, must be determined.
  \item Based on the target model, service models must be identified and associated with characteristics.
  \item A service inventory must be put in place, covering the relevant information of the involved services in a SOA. Beyond the information covered in a service interface (e.g. operations, messages, entities), there is the call-graph, type of operations (e.g. CRUD\footnote{CRUD - Create, Remove, Update and Delete}, business logic) and service model required.
  \item Based on metrics defined in existing research contributions, the parameters of the service design are measured and collected.
  \item Per service model, relevant metrics are assigned to control the  service design against SOA best practice guidelines. Worth mentioning in this respect is also, that enterprises, applying this approach, could assign different metrics per service models, as per enterprise, slightly different design criteria for services might exist.
\end{enumerate}
\noindent
Besides addressing these three steps listed above, the thesis intents, to give an understandable presentation, of how could be existing metrics mapped to various service models. In particular, per service model the best of breed guidelines are discussed and suitable metrics are set in relation. Moreover, extreme values of metrics are investigated to detect design flaws  in an early SOM stage.
\newline
\noindent
Last but not least, the whole approach is assessed by means of qualitative interviews to assess the relevance of the approach for the SOA practice.

\section{Methodological Approach}
\vspace{-4mm}
A clear methodological approach is required to achieve the previously mentioned objectives. With respect of this thesis, the design science (DS) paradigm \parencite{Hevner2004} is followed.

\begin{figure}[ht]
		\begin{center}
	    	\includegraphics[page=6, trim=2.7cm 14.3cm 4.9cm 3.8cm, keepaspectratio=true, scale=0.75, clip=true]{graphics/dsr}
			\caption[Information Systems Research Framework]{Information Systems Research Framework
		 \parencite{Hevner2004}}
			\label{Information Systems Research Framework}
		\end{center}
\end{figure}

\noindent
Reflecting the environment of this thesis, service granularity, with respect to service engineering within a SOA, is seen by the practice as crucial parameter for the success of a SOA initiative. To investigate the environment, a structural literature review about service granularity disclose the current state of the knowledge base in research. By unifying the collected facts out of the environment and the knowledge base, a novel approach, which outlines the necessity of measuring service granularity and its dependent parameters cohesion and coupling, is derived, built and documented. Going further, as SOA defines various service models, service granularity is different per defined service model. Thus, existing metrics for service granularity, cohesion and coupling in the knowledge base are related with service models, to finally indicate, whether a given service candidate fulfills the best practice requirements of a service model\footnote{Note, various service models and service layering, defined in the literature as best practices, are explained in the upcoming chapter \textit{Theoretical Foundation}.}. Considering the four distinguished design artifacts resulting of DS research approaches \parencite[p. 78]{Hevner2004}, the resulting artifact of this thesis will be a method, which will outline the explained steps above. The evaluation of the resulting design artifact will be done by means of qualitative interviews. The involved participants are experts in the area of SOA and BPM. They can asses the design artifacts with having the dimensions of IS research such as people, organization and technology in mind. The results of the evaluation will be discussed and requirements for upcoming evaluation loops will be made transparent. Worth mentioning in this respect is, that only one evaluation loop (general scope of a master thesis at the University of Liechtenstein) is executed in the context of this thesis. Thus, this thesis serves a general foundation for any ongoing evaluation loops in this area.
\newline
\noindent
The reminder of the thesis is dived into further five chapters, as seen in figure \ref{Thematic overview}. Firstly, the theoretical foundation is laid by structuring the basic concepts such as service granularity, cohesion, coupling, service layering in connection with service models. Secondly, the quantitative and qualitative results of the literature research are presented and discussed. Thirdly, the design and documentation of the design artifact outlines the details of an approach to measure service granularity with relation to service models. The next chapter reveals the evaluation setup, its results and sets up the requirement for further evaluation loops. Last but not least, the conclusion outlines the possible role of such a method in the SOA practice in the future.

\begin{figure}[ht]
		\begin{center}
	    	\includegraphics[page=2, trim=3.37cm 2.10cm 2.81cm 1.62cm, keepaspectratio=true, scale=0.70, clip=true]{graphics/approach}
			\caption[Thematic overview]{Thematic overview}
			\label{Thematic overview}
		\end{center}
\end{figure}